package com.by.example.consumer;

import com.by.example.common.model.User;
import com.by.example.common.service.UserService;
import com.by.rpc.proxy.ServiceProxyFactory;

/**
 * @author lzh
 */
public class EasyConsumerExample {

    public static void main(String[] args) {
        // 静态代理
        //UserService userService = new UserServiceProxy();

        // 动态代理
        UserService userService = ServiceProxyFactory.getProxy(UserService.class);
        User user = new User();
        user.setName("baiyu");
        User newUser = userService.getUser(user);
        System.out.println("用户名：" + newUser.getName());
    }
}
